<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRoomConfigsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('room_configs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->decimal('area', 10, 2)->comment('面积(平米)');
            $table->decimal('price', 10, 2)->comment('租金');
            $table->unsignedTinyInteger('cycle')->comment('收费周期(默认一个月)')->default(1);
            $table->string('cycle_unit', '10')->comment('收费周期单位(年月日)')->default(1);
            $table->unsignedTinyInteger('bet_count')->default(1);
            $table->unsignedTinyInteger('pay_count')->default(1);
            $table->string('image');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('room_configs');
    }
}
